import { Injectable, OnInit } from "@angular/core";
import { Router, RouterModule } from "@angular/router";
import { Http, Response } from "@angular/http";
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import 'rxjs/add/operator/map';
import { GlobalStateService } from "./global-state.service";

@Injectable() 
export class ApiService {
    constructor( private http: Http,  
        private _router: Router){ }

    // getCities(platform: string):Observable<string[]> {
    getCities(platform: string) {
        // return '';
        // return this.http.post('http://localhost:8088/api/auth/login', 
        //     JSON.stringify({
        //         "username": "admin",
        //         "password": "123.gome"
        //     })).map((resp: Response) => {
        //         let token = resp.json() ? resp.json().token: '';
        //         console.log(resp.status);
        //         this._globalState.token = token;
        //         this._cookie.put('token', token);
        //         return false;
        //     })
    }
}